package com.mq.order;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author ytj
 * @date 2024/1/23
 */
@Component
public class Demo11Producer {
    @Resource
    private RabbitTemplate rabbitTemplate;

    public void send(Integer id){
        Integer num=id%Demo11Message.total;
        Demo11Message demo11Message=new Demo11Message(id);
        this.rabbitTemplate.convertAndSend(Demo11Message.BASE_EXCHANGE,num+"",demo11Message);
    }
}
